<?php include 'application/views/header.php' ?>
<?php include 'application/views/left.php' ?>
<?php //echo '<pre>'; print_r($_SERVER); die; ?>
<div class="content-box box-task">
    <div class="title">
        <div class="label">Danh sách công việc</div>
        <div class="end-title"></div>
    </div>
    <!-- content -->
    <div class="box-task-content clr">
        <?php if(!is_null($Tasks) || count($Tasks) > 0): ?>
            <table class="list-task" cellpadding="0" cellspacing="0">
                <tr>
                    <th width="10px">STT</th>
                    <th>Tên công việc</th>
                    <th>Người tạo</th>
                    <th>Trạng thái</th>
                </tr>
                <?php $index = 0 ?>
                <?php foreach($Tasks as $task): ?>
                <tr>
                    <td><?php echo ++$index ?></td>
                    <td><a href="<?php echo site_url() ?>task/detail/<?php echo $task['TaskId'] ?>.html"><?php echo $task['TaskName'] ?></a></td>
                    <td><?php echo $task['FullName'] ?></td>
                    <td><a href="<?php echo site_url() ?>task/change_status/<?php echo $task['TaskId'] ?>/<?php echo $task['TaskStatus'] == 'PENDING' ? 'COMPLETED' : 'PENDING'  ?>.html" 
                        title="Click vào đây để đổi trạng thái">
                        <?php echo $task['TaskStatus'] ?></a></td>
                </tr>
                <?php endforeach; ?>
            </table>
            <div class="pagination-list">
                <?php echo $Pagination->create_links(); ?>
            </div>
        <?php else: ?>
            <div>Hiện tại không có công việc nào giành cho bạn.</div>
        <?php endif; ?>
    </div>
</div>

<?php include 'application/views/right.php' ?>
<?php include 'application/views/footer.php' ?>